package chapter10.practice3;

/**
 * Created by yangliwei on 2017/10/19.
 */
public class Outer {
    private String data;

    public Outer(String data) {
        this.data = data;
    }

    private class Inner{
        @Override
        public String toString() {
            return data;
        }
    }

    public Inner getInner(){
        return new Inner();
    }

    public static void main(String[] args) {
        Outer outer = new Outer("hello shagou");
        //因为在这个类里面使用所以不用写成 Outer.Inner inner = outer.getInner();
        Inner inner = outer.getInner();
        System.out.println(inner);
    }
}
